<?php
class ArticleModel extends Model{

	protected $_auto = array(
		array('created_at','strtotime',3,'function'),
		array('updated_at','get_update_at',3,'callback'),
		array('sort','intval',3,'function'),
	);

	protected $_validate = array(
		array('title','require','文章标题不能为空...'),
		array('content','require','文章内容不能为空...'),
		array('is_show',array(0,1),'是否显示只能为内置的显示或不显示...',2,'in')
	);

	public function get_update_at(){
		return max(strtotime($_POST['created_at']),time());
	}

}
?>